package com.anche.cywebnew.Service.systemManager.Impl;

import com.anche.cywebnew.DAO.systemManager.TerminalMapper;
import com.anche.cywebnew.Pojo.systemManager.TerminalInfo;
import com.anche.cywebnew.Service.systemManager.TerminalService;
import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
//import jdk.nashorn.internal.ir.Terminal;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class TerminalServiceImpl implements TerminalService {

    @Autowired
    private TerminalMapper terminalMapper;

    @Override
    public Page<TerminalInfo> getTerminalPager(Integer page, Integer limit, TerminalInfo terminal) {
        Page<TerminalInfo> page1 = PageHelper.startPage(page, limit);
        terminalMapper.getTerminalInfos(terminal);
        return page1;
    }

    @Override
    public void setIsLocked(String num_id, String islocked) {
        terminalMapper.updateIsLockedByNumId(num_id,islocked);
    }

    @Override
    public TerminalInfo getTerminalById(String num_id) {
        return terminalMapper.getTerminalById(num_id);
    }
}
